package com.eop.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "eop_Minutes")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@NamedQueries( { @NamedQuery(name = "sMinutes.getMinutesByEvent", query = "from Minutes as mt where mt.siEvent.id=? and mt.minutes_DelFlag=false order by minutesDate") })
public class Minutes {
	/**
	 * ID
	 */
	@Id
	private String id;

	/**
	 * 应急事件
	 */
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "eventId")
	private Event siEvent;

	/**
	 * 会议记录
	 * 
	 * 此处做了修改，可以保存超大型的文本数据
	 */
	// @Lob
	// @Basic(fetch = FetchType.LAZY)
	// @Column(columnDefinition = "VARBINARY")
	// private byte[] minutes;

	@Basic(fetch = FetchType.LAZY)
	@Column(columnDefinition = "text")
	private String minutes;

	/**
	 * 会议记录日期
	 */
	private Date minutesDate;

	private String creator;

	public Date getMinutesDate() {
		return minutesDate;
	}

	public void setMinutesDate(Date minutesDate) {
		this.minutesDate = minutesDate;
	}

	/**
	 * 是否删除 0 未删除 1 删除
	 */
	private boolean minutes_DelFlag;

	public boolean isMinutes_DelFlag() {
		return minutes_DelFlag;
	}

	public void setMinutes_DelFlag(boolean minutesDelFlag) {
		minutes_DelFlag = minutesDelFlag;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Event getSiEvent() {
		return siEvent;
	}

	public void setSiEvent(Event siEvent) {
		this.siEvent = siEvent;
	}

	public String getMinutes() {
		return minutes;
	}

	public void setMinutes(String minutes) {
		this.minutes = minutes;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

}
